Skip to content

ci(targeted-verification): let "Re-run failed jobs" find the shard selection - #2001

Merged
khaliqgant merged 2 commits into
mainfrom
ci/targeted-verification-rerun
Oct 27, 2026
Merged

khaliqgant merged 2 commits into
mainfrom
ci/targeted-verification-rerun

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Problem

targeted-feature-verification.yml uploads the shard selection as targeted-feature-selection-${{ github.run_id }}-${{ github.run_attempt }} from the select job, and each Flows v2 shard downloads the same name. Re-run failed jobs only re-runs the failed shards; select succeeded, so it is not re-run and nothing uploads an artifact for the new run_attempt. Every re-attempted shard then fails at Download immutable selection with Artifact not found, so the only way to retry a flaky shard was to re-run the whole workflow.

Fix

  • Name the selection artifact targeted-feature-selection-${{ github.run_id }} (no run_attempt) in both the upload and download steps. Artifacts uploaded by an earlier attempt are still listed for later attempts of the same run, so a re-attempted shard downloads the selection the original select job produced.
  • Upload with overwrite: true. With upload-artifact v4, uploading a name that already exists in the run is a 409 conflict, which would otherwise break Re-run all jobs (where select runs again). The selection is computed from the same base/head SHAs, so replacing it is equivalent.
  • Per-shard evidence artifacts (targeted-feature-plan-...-${{ github.run_attempt }}-<shard>) keep run_attempt. Each attempt uploads its own, so they don't collide.
  • Added a fixture test assertion that pins the run-scoped name and overwrite: true.

Test plan

  • actionlint (rhysd/actionlint docker image) clean
  • npx vitest run tests/fixtures/targeted-feature-verification.test.ts -t "workflow|Re-run" passes
  • After merge: re-run only a failed shard on a PR and confirm the download step succeeds

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Agent Relay sessions

  • claude session a5019981 · opened via gh pr create · last active 2026-10-27

…lection

The selection artifact was named with run_attempt, but "Re-run failed
jobs" does not re-run the select job, so re-attempted shards looked for
an artifact from the new attempt that was never uploaded and failed
with "Artifact not found". Key the artifact by run_id only (earlier
attempts' artifacts remain downloadable within the same run) and upload
with overwrite: true so "Re-run all jobs" can replace it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T07:48:27.892235Z 137b1a1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6fe33785-4a73-4f54-b45f-9b0a737ebd47
Commits

Reviewing files that changed from the base of the PR and between 137b1a1 and 9fcdbdc.

Files selected for processing: 1
  • tests/fixtures/targeted-feature-verification.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Walkthrough

The targeted feature verification workflow now names its shard-selection artifact by run ID, overwrites the artifact on upload, and downloads it using the same name. A workflow test checks these settings.

Changes: Shard-selection artifact reuse

Layer / File(s) Summary
Artifact naming and verification
.github/workflows/targeted-feature-verification.yml, tests/fixtures/targeted-feature-verification.test.ts
The workflow uses github.run_id for artifact upload and download. Uploads enable overwrite: true. The test checks both artifact names and the overwrite setting.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to 9fcdb

The rerun artifact path is aligned and verified by the fixture; no merge-blocking risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description clearly explains the problem, fix, affected artifacts, and test results. However, it omits the required RelayFlow Proof section and does not provide the required change type or case va… Add the RelayFlow Proof section with a valid Change type and RelayFlow case. Use non-functional and n/a if runtime behavior is unchanged.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: allowing failed targeted-verification jobs to find the shard selection artifact.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Full details: Description check

Explanation

The description clearly explains the problem, fix, affected artifacts, and test results. However, it omits the required RelayFlow Proof section and does not provide the required change type or case values.

Resolution

Add the RelayFlow Proof section with a valid Change type and RelayFlow case. Use non-functional and n/a if runtime behavior is unchanged.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the run ID twice,
The artifact keeps its matching name.
It may be replaced on a rerun,
Then downloaded without a change.
The workflow test confirms the way,
And hops along its verified day.

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no blocking issues remain.

Summary

The PR gives shard selection artifacts a run-scoped name so failed shards can reuse them on retry.

  • Failed shards can reuse the selection artifact from their workflow run.

Reviews (2) · Last reviewed commit: "test(targeted-verification): assert sele..." · Reviewed by Greptile

Parse the workflow and check the upload/download steps directly so the
overwrite assertion cannot match a different step.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@khaliqgant
khaliqgant merged commit e6fcba4 into main Oct 27, 2026
76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant